<template>
  <div class="">
    <h1>搜索结果页面</h1>
    <van-card
      v-for="(item, index) in res"
      :key="index"
      :price="item.price"
      :title="item.title"
      thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
    />
  </div>
</template>

<script>
import list from "../../public/data.json";
export default {
  data() {
    return {
      list: list.list,
      search: this.$route.query.search,
      res: [],
    };
  },
  mounted() {
    this.res = this.list.filter((item) => {
      return item.title.includes(this.search);
    });
  },
  methods: {},
  components: {},
};
</script>

<style lang="scss"></style>
